<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 开发环境版本，包含了有帮助的命令行警告 -->
<script src="vue.js"></script>
</head>
<body>
    <div id="root">
        <h2>姓名：{{student.name}}</h2>
        <h2>性别：{{student.sex}}</h2>
        <h2>年龄：{{student.age}}</h2>
        <h2>朋友</h2>
        <ul>
            <li v-for="(p,index) in student.friends" :key="index">
                {{p.name}} -- {{p.age}}
            </li>
        </ul>
    </div>
   <script type="text/javascript">
    // Vue.set(vm.student,'sex','女')
    // vm.student.friends.push({name:'nginx',age:30})
    const vm = new Vue({
        el:'#root',
        data: {
            student:{
                name:'学习',
                age:14,
                friends: [{name:'tom',age:10},{name:'cat',age:14}]
            }
        }
    })
   </script>
</body>
</html>